#include <sys/style.hpp>
#include <sys/asm.hpp>
#include <global/irq.hpp>
#include <global/pic.hpp>

void                  pic::outb   (type::u16 port, type::u8 value)
{
  outb_asm(port,value);
}
type::u8              pic::inb    (type::u16 port)
{
  return inb_asm(port);
}
void                  pic::init   ()
{
  outb_asm(master:: cmd_port(),    master::  icw1() );
  outb_asm(master:: data_port(),   master::  icw2() );
  outb_asm(master:: data_port(),   master::  icw3() );
  outb_asm(master:: data_port(),   master::  icw4() );
  outb_asm(master:: data_port(),   irq::     ocw1_disable_all() );
  outb_asm(slave::  cmd_port(),	   slave::   icw1() );
  outb_asm(slave::  data_port(),   slave::   icw2() );
  outb_asm(slave::  data_port(),   slave::   icw3() );
  outb_asm(slave::  data_port(),   slave::   icw4() );
  outb_asm(slave::  data_port(),   irq::     ocw1_disable_all() );	
}
